﻿

using UnityEngine;

namespace UnityEngine.Helper
{
    public class CommonUtils
    {
        public static RenderTexture CreateDyanmicAtlasRenderTexture(int width, int height, int depth, RenderTextureFormat format)
        {
            RenderTexture rt = new RenderTexture(width, height, depth, format);
            rt.autoGenerateMips = false;
            rt.useMipMap = false;
            rt.filterMode = FilterMode.Bilinear;
            rt.wrapMode = TextureWrapMode.Clamp;
            rt.Create();
            return rt;
        }
        public static string RemoveFileExtension(string path)
        {
            if (path == null)
            {
                return null;
            }
            int __indexDot = path.LastIndexOf('.');
            if (__indexDot != -1)
            {
                return path.Substring(0, __indexDot);
            }
            return path;
        }
    }
}
